class GameEngine {
public:
	GameEngine();
	int loadSDL();
	int cleanSDL();
	bool gameLoop();
	bool renderLoop();
	void setBg(const char* bgfile);
	bool intersectCheck(int x, int y, Rect rect);
	void setScript(GlobalScript *gscript);
	void setGameName(const char *gameName);
	void setDefaultBg(const char *bdefaultBg);
	void setspeechBackground(const char *speechBackground);
	void setInventory(const char *i);
	void setInventoryBg(const char *iBg);
	int getTimePassed();
	void fadeIn(int time);
	void fadeOut(int time);
private:
	int time, diff, lastTime;
	SDL_Event event;
	bool quit;
	SDL_Surface* screen;
	SDL_Rect rcPlayerSprite;
	SDL_Rect rcSpeechSprite;
	SDL_Rect rcAnimation;
	SDL_Rect rcInventorySprite;
	SDL_Surface* playerSprite;
	SDL_Surface* speechSurface;
	SDL_Surface* bg;
	SDL_Surface* inventoryBgSurface;
	SDL_Surface* inventorySurface;
	SDL_Surface* alphaScreen;
	Rect speechChoice[4];
	Rect inventoryPos;
	int currentAction;
	GlobalScript *script;
	Cursors *cursors;
	char *gameName;
	char *defaultBg;
	char *inventoryBg;
	char *inventory;
	char *speechBackground;
	bool fading;
	bool fadingIn;
	bool inventoryOpen;
	unsigned int fadeTime;
	unsigned int fadeRate;
	int alpha;
};